﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mangosoft.DiceCopy.Presentation.Domain.Contracts;
using Mangosoft.DiceCopy.Presentation.Domain.Models;
using Mangosoft.DiceCopy.Presentation.Domain.JobHuntingModuleService;

namespace Mangosoft.DiceCopy.Presentation.Domain.Agents {
    public class AdvertisingAgent : IAdvertisingAgent {
        public List<AdvertisingModel> GetPublishedAdvertisings(int blockcode) {
            var client = new JobHuntingModuleServiceClient();

            var ads = client.FindAdvertisingsByBlock(blockcode).Select(
                a => new AdvertisingModel {
                     Title = a.Title,
                     NavigateUrl = a.Title
                }).ToList();

            //for (int i = 0; i < 100; i++) {
            //    int blockcode = i % 30;
            //    ads.Add(new AdvertisingModel { Title = "ad" + i.ToString(), NavigateUrl = "http://www.sohu.com", BlockCode = i });
            //}
            return ads;
        }
    }
}
